package com.ruoyi.asms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.asms.domain.AsmsOwnAddressAssetCode;
import com.ruoyi.asms.mapper.AsmsOwnAddressAssetCodeMapper;
import com.ruoyi.asms.service.IAsmsOwnAddressAssetCodeService;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 位置码信息Service业务层处理
 * 
 * @author yfkj
 * @date 2021-10-21
 */
@Service
public class AsmsOwnAddressAssetCodeServiceImpl extends ServiceImpl<AsmsOwnAddressAssetCodeMapper, AsmsOwnAddressAssetCode>  implements IAsmsOwnAddressAssetCodeService
{
    @Autowired
    private AsmsOwnAddressAssetCodeMapper asmsOwnAddressAssetCodeMapper;

    /**
     * 查询位置码信息
     * 
     * @param addressCodeId 位置码信息主键
     * @return 位置码信息
     */
    @Override
    public AsmsOwnAddressAssetCode selectAsmsOwnAddressAssetCodeByAddressCodeId(Long addressCodeId)
    {
        return asmsOwnAddressAssetCodeMapper.selectAsmsOwnAddressAssetCodeByAddressCodeId(addressCodeId);
    }

    /**
     * 查询位置码信息列表
     * 
     * @param asmsOwnAddressAssetCode 位置码信息
     * @return 位置码信息
     */
    @Override
    public List<AsmsOwnAddressAssetCode> selectAsmsOwnAddressAssetCodeList(AsmsOwnAddressAssetCode asmsOwnAddressAssetCode)
    {
        return asmsOwnAddressAssetCodeMapper.selectAsmsOwnAddressAssetCodeList(asmsOwnAddressAssetCode);
    }

    /**
     * 新增位置码信息
     * 
     * @param asmsOwnAddressAssetCode 位置码信息
     * @return 结果
     */
    @Override
    public int insertAsmsOwnAddressAssetCode(AsmsOwnAddressAssetCode asmsOwnAddressAssetCode)
    {
        asmsOwnAddressAssetCode.setCreateTime(System.currentTimeMillis());
        asmsOwnAddressAssetCode.setCreateBy(SecurityUtils.getUsername());
        return asmsOwnAddressAssetCodeMapper.insertAsmsOwnAddressAssetCode(asmsOwnAddressAssetCode);
    }

    /**
     * 修改位置码信息
     * 
     * @param asmsOwnAddressAssetCode 位置码信息
     * @return 结果
     */
    @Override
    public int updateAsmsOwnAddressAssetCode(AsmsOwnAddressAssetCode asmsOwnAddressAssetCode)
    {
        asmsOwnAddressAssetCode.setUpdateTime(System.currentTimeMillis());
        asmsOwnAddressAssetCode.setUpdateBy(SecurityUtils.getUsername());
        return asmsOwnAddressAssetCodeMapper.updateAsmsOwnAddressAssetCode(asmsOwnAddressAssetCode);
    }

    /**
     * 批量删除位置码信息
     * 
     * @param addressCodeIds 需要删除的位置码信息主键
     * @return 结果
     */
    @Override
    public int deleteAsmsOwnAddressAssetCodeByAddressCodeIds(Long[] addressCodeIds)
    {
        return asmsOwnAddressAssetCodeMapper.deleteAsmsOwnAddressAssetCodeByAddressCodeIds(addressCodeIds);
    }

    /**
     * 删除位置码信息信息
     * 
     * @param addressCodeId 位置码信息主键
     * @return 结果
     */
    @Override
    public int deleteAsmsOwnAddressAssetCodeByAddressCodeId(Long addressCodeId)
    {
        return asmsOwnAddressAssetCodeMapper.deleteAsmsOwnAddressAssetCodeByAddressCodeId(addressCodeId);
    }
}
